package com.tongji.diy.controller
{
	import com.tongji.diy.event.FurnitureManualRotationEvent;
	import com.tongji.diy.model.FurnitureModel;
	
	import org.robotlegs.mvcs.Command;
	
	public class FurnitureMaunalRotationCommand extends Command
	{
		
		[Inject]
		public var event:FurnitureManualRotationEvent;
		[Inject]
		public var model:FurnitureModel;
		
		public function FurnitureMaunalRotationCommand()
		{
			super();
		}
		override public function execute():void
		{
			switch(event.type)
			{
				case FurnitureManualRotationEvent.FURNITURE_ROTATION_CLOCKWISE:
					model.furnitureMaunalRotation(event.furnitureIndex, true);
					break;
				case FurnitureManualRotationEvent.FURNITURE_ROTATION_COUNTERCLOCKWISE:
					model.furnitureMaunalRotation(event.furnitureIndex, false);
					break;
			}
		}
	}
}